<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .left,
        .right,
        .middle {
            float: left;
        }

        .left,
        .right {
            border: 1px solid #eee;
            width: 100px;
            height: 200px;
            line-height: 28px;
            text-align: center;
        }

        .active {
            background-color: #eee;
        }
    </style>
</head>

<body>
    <div class="left">
        <div class="active">张三</div>
        <div>李四</div>
        <div>王五</div>
        <div>赵六</div>
        <div>孙七</div>
        <div>王八</div>
    </div>
    <div class="middle">
        <input type="button" value=">" />
        <input type="button" value="<" />
    </div>
    <div class="right">
    </div>
    <script>
        var leftdiv = document.querySelectorAll('.left>div');
        console.log(leftdiv);
        for (var i = 0; i < leftdiv.length; i++)
            leftdiv[i].onclick = function () {
                document.querySelector(".left>.active")&&document.querySelector(".left>.active").removeAttribute('class');
                this.className = 'active';
            }
        var btnDom = document.querySelectorAll('.middle>input')[0];
        btnDom.onclick = function () {
            document.querySelector('.right').appendChild(document.querySelector('.active'));

        }
        var btnDom1 = document.querySelectorAll('.middle>input')[1];
        btnDom1.onclick = function () {    
            document.querySelector('.left').appendChild(document.querySelector('.right>.active'));
        } 
    </script>
</body>

</html>